From 1f9c267a70776b30bfe3346c78f874215a371100 Mon Sep 17 00:00:00 2001 From: Alex Williamson Date: Thu, 29 Nov 2007 11:54:31 -0700 Subject: [PATCH] [IA64] Create common guest_os_type domain config option This is an optional domain config entry that may be used by architecture specific builder code to setup various optimizations based on the guest OS intended to run in the domain. Based on patch from Zhang Xin. Signed-off-by: Alex Williamson Acked-by: Keir Fraser --- tools/python/xen/xend/XendConfig.py | 3 ++- tools/python/xen/xend/image.py | 1 + tools/python/xen/xm/create.py | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index 2f038da719..d43355d2ba 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -129,7 +129,8 @@ XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 'boot', 'device_model', 'display', 'nographic', 'pae', 'rtc_timeoffset', 'serial', 'sdl', 'soundhw','stdvga', 'usb', 'usbdevice', 'vnc', 'vncconsole', 'vncdisplay', 'vnclisten', 'timer_mode', - 'vncpasswd', 'vncunused', 'xauthority', 'pci', 'vhpt'] + 'vncpasswd', 'vncunused', 'xauthority', 'pci', 'vhpt', + 'guest_os_type' ] # Xen API console 'other_config' keys. XENAPI_CONSOLE_OTHER_CFG = ['vncunused', 'vncdisplay', 'vnclisten', diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index f84d0dca7d..a660e9faec 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -426,6 +426,7 @@ class HVMImageHandler(ImageHandler): self.apic = int(vmConfig['platform'].get('apic', 0)) self.acpi = int(vmConfig['platform'].get('acpi', 0)) + self.guest_os_type = vmConfig['platform'].get('guest_os_type') # Return a list of cmd line args to the device models based on the # xm config file diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py index b90e29d286..b1ec86afa7 100644 --- a/tools/python/xen/xm/create.py +++ b/tools/python/xen/xm/create.py @@ -454,6 +454,10 @@ gopts.var('usbdevice', val='NAME', fn=set_value, default='', use="Name of USB device to add?") +gopts.var('guest_os_type', val='NAME', + fn=set_value, default='default', + use="Guest OS type running in HVM") + gopts.var('stdvga', val='no|yes', fn=set_bool, default=0, use="Use std vga or cirrhus logic graphics") @@ -733,7 +737,9 @@ def configure_hvm(config_image, vals): 'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'soundhw', 'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'vnclisten', 'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor', - 'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci' ] + 'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', + 'guest_os_type'] + for a in args: if a in vals.__dict__ and vals.__dict__[a] is not None: config_image.append([a, vals.__dict__[a]]) -- 2.30.2